package test.y2019.september;

import learn.baidu.OnlyWord;
import cn.hutool.core.lang.Console;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2019/9/9 10:53
 */
public class September1 {
    public static void main(String[] args) {

        OnlyWord onlyWord = new OnlyWord("First", "First_word_NAME", 21, true, false);
        OnlyWord onlyWord1 = new OnlyWord("Second", "Second_word_NAME", 22, false, true);
        OnlyWord onlyWord2 = new OnlyWord("Third", "Third_word_NAME", 23, true, false);
        List<OnlyWord> objects = new ArrayList<>();
        objects.add(onlyWord);
        objects.add(onlyWord1);
        objects.add(onlyWord2);

        System.out.println("hutool:");
        Console.error(JSONUtil.toJsonPrettyStr(objects));

        System.out.println("fastJson:");
        Console.error(JSONObject.toJSONString(objects));
    }
}
